#include <bsd/stdlib.h>
#include <string.h>

#include "rid.h"

void
rid_set(Rid to, const Rid from)
{
	if (from)
		memcpy(to, from, sizeof(Rid));
	else
		arc4random_buf(to, sizeof(Rid));
}

int
rid_cmp(const Rid id1, const Rid id2)
{
	return memcmp(id1, id2, sizeof(Rid));
}
